import { reactive, onMounted, toRefs } from 'vue';

export const useSystemInfo = () => {
	const state = reactive<{
		systemInfo : any;
		statusBarHeight : number;
		menuButtonHeight : number;
	}>({
		systemInfo: {},
		statusBarHeight: 0,
		menuButtonHeight: 44
	});


	onMounted(() => {
		const systemInfo = uni.getSystemInfoSync();
		state.systemInfo = systemInfo;
		state.statusBarHeight = systemInfo.statusBarHeight + state.menuButtonHeight;
	})

	return toRefs(state);
}